package com.cirkana.viewer.data.criteria;

import com.cirkana.data.DataException;


public class StringEqualsDataCriteria extends DataCriteria {

	protected StringEqualsDataCriteria(String column, String value) {
		super(column, OPERATOR_EQUALS, value);
	}

	@Override
	public String getSelection() throws DataException {
		StringBuilder s = new StringBuilder();
		s.append(this.column);
		s.append(" ");
		if (this.value == null)
			s.append("IS NULL");
		else {
			s.append(OPERATOR_EQUALS);
			s.append(" '");
			s.append(this.value);
			s.append("'");
		}
		return s.toString();
	}

}
